package com.rpc.comsumer;

import agan.rpc.protocol.Invocation;
import agan.rpc.protocol.HttpClient;
import agan.rpc.proxy.ProxyFactory;
import com.agan.producer.common.service.HelloService;

public class Consumer {
    public static void main(String[] args) {
//        HttpClient client = new HttpClient();
//        Invocation invocation = new Invocation(HelloService.class.getName(),
//                "sayHello", new Class[]{String.class}, new Object[]{"阿肝测试RPC"});
//        String result = client.send("localhost", 8080, invocation);
//        System.out.println(result);

        HelloService helloService = ProxyFactory.getProxy(HelloService.class);
        String result = helloService.sayHello("阿肝测试RPC");
        System.out.println(result);
    }
}
